feat: add HTTP server hosting support with SSE transport#22
Open
feat: add HTTP server hosting support with SSE transport#22
Conversation
- Add Express and CORS dependencies for HTTP server support - Implement SSE (Server-Sent Events) transport for remote MCP connections - Add CLI options to choose between stdio and HTTP modes - Create health check endpoint for server monitoring - Update documentation with HTTP server deployment instructions - Add npm scripts for running in HTTP mode (start:http) - Maintain backward compatibility with stdio mode as default - Server runs on port 3000 by default, configurable via --port flag This enables the YNAB MCP server to be hosted remotely and accessed via HTTP/SSE instead of only running locally via stdio.
Add high-priority test suites covering: HTTP Server Tests (16 tests): - Server configuration (CORS, JSON middleware) - Health endpoint (status, version, response time, concurrency) - Message endpoint (405 error handling) - Error handling (invalid routes, malformed requests) CLI Tests (23 tests): - Mode selection (stdio vs HTTP) - Port configuration (default, custom, short/long flags) - Version and help information - Argument combinations and edge cases Tool Registration Tests (128 tests): - All 16 tools verified for exports (name, description, schema, execute) - Tool naming conventions (snake_case, ynab_ prefix) - Input schema validation - Execute function signatures - Registration process verification SSE Connection Tests (21 tests): - Connection handling and lifecycle - Multiple concurrent connections - Transport configuration - Server configuration per connection - CORS and request headers - Error handling All 357 tests passing (169 existing + 188 new) Test coverage for HTTP server, CLI parsing, tool registration, and SSE transport
Docker Changes: - Update Dockerfile to run in HTTP mode with --http flag - Expose port 3000 for HTTP server access - Set default port to 3000 (configurable via CMD override) - Add .dockerignore for optimized Docker builds (excludes node_modules, tests, etc) Documentation Updates: - Add comprehensive Docker deployment section to README - Include examples for building, running, health checks, and logs - Document custom port configuration for Docker - Add Docker quick reference to CLAUDE.md This enables easy containerized deployment of the YNAB MCP server with HTTP/SSE transport for remote access scenarios.
Dockerfile Changes: - Add --platform=linux/amd64 to FROM instruction for consistent builds - Change default port from 3000 to 80 (standard HTTP port) - Update EXPOSE directive to port 80 - Update CMD to use --port 80 Documentation Updates: - Update README.md Docker section with port 80 examples - Add port mapping examples (80:80, 3000:80, custom ports) - Document multi-platform build options using buildx - Update CLAUDE.md Docker quick reference to use port 80 - Add example for mapping container port 80 to host port 3000 This provides a standard HTTP port configuration for Docker deployments while maintaining flexibility for custom port mappings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This enables the YNAB MCP server to be hosted remotely and accessed
via HTTP/SSE instead of only running locally via stdio.